<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    {:token()}
    <?php if($row['apply_type'] != 40):?>
    <div class="form-group">
        <label for="c-image" class="control-label col-xs-12 col-sm-2">营业执照:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="hm-edit-img-show">
                <a href="{$row['details']['license_copy']}" target="_blank">
                    <img class="img-rounded img-thumbnail" src="{$row['details']['license_copy']}" />
                </a>
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">主体类型:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[details][subject_type]', ['SUBJECT_TYPE_INDIVIDUAL'=>'个体', 'SUBJECT_TYPE_INSTITUTIONS'=>'公司'],$row['details']['subject_type'])}
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">主体名称:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" name="row[details][merchant_name]" value="{$row['details']['merchant_name']|htmlentities}" data-rule="required" />
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">统一社会信用代码:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" name="row[details][license_number]" value="{$row['details']['license_number']|htmlentities}" data-rule="required" />
        </div>
    </div>
    <div class="form-group">
        <label for="c-image" class="control-label col-xs-12 col-sm-2">身份证:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="hm-edit-img-show">
                <a href="{$row['details']['id_card_copy']}" target="_blank">
                    <img class="img-rounded img-thumbnail" src="{$row['details']['id_card_copy']}" />
                </a>
            </div>
            <div class="hm-edit-img-show">
                <a href="{$row['details']['id_card_national']}" target="_blank">
                    <img class="img-rounded img-thumbnail" src="{$row['details']['id_card_national']}" />
                </a>
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">用户姓名:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" name="row[details][id_card_name]" value="{$row['details']['id_card_name']|htmlentities}" data-rule="required" />
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">身份证号:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" name="row[details][id_card_number]" value="{$row['details']['id_card_number']|htmlentities}" data-rule="required" />
        </div>
    </div>
    <?php if($row['apply_type'] == 20):?>
    <?php if(!empty($row['details']['qualifications'])):?>
    <div class="form-group">
        <label for="c-image" class="control-label col-xs-12 col-sm-2">特殊资质:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="hm-edit-img-show">
                <a href="{$row['details']['qualifications']}" target="_blank">
                    <img class="img-rounded img-thumbnail" src="{$row['details']['qualifications']}" />
                </a>
            </div>
        </div>
    </div>
    <?php endif;?>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">开户银行:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" name="row[details][bank_name]" value="{$row['details']['bank_name']|htmlentities}" data-rule="required" />
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">银行账号:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" name="row[details][account_number]" value="{$row['details']['account_number']|htmlentities}" data-rule="required" />
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">支付商户号:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" name="row[mchid]" value="{$row['mchid']|htmlentities}"/>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">商户简称:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" name="row[merchant_shortname]" value="{$row['merchant_shortname']|htmlentities}" data-rule="required" />
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">小程序APP_ID:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" name="row[app_id]" value="{$row['app_id']|htmlentities}" data-rule="required" />
        </div>
    </div>
    <?php endif;?>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">联系电话:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" name="row[details][mobile_phone]" value="{$row['details']['mobile_phone']|htmlentities}" data-rule="required" />
        </div>
    </div>
    <?php if($row['apply_type'] == 10 OR $row['apply_type'] == 30):?>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">用户微信号:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" name="row[details][legal_persona_wechat]" value="{$row['details']['legal_persona_wechat']|htmlentities}" data-rule="required" />
        </div>
    </div>
    <?php endif; else:?>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">代理级别:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[agent_mode]', ['10'=>'县区', '20'=>'市级', '30'=>'省级'],$row['agent_mode'])}
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">姓名:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" name="row[details][id_card_name]" value="{$row['details']['id_card_name']|htmlentities}" data-rule="required" />
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">电话:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" name="row[details][mobile_phone]" value="{$row['details']['mobile_phone']|htmlentities}" data-rule="required" />
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">区域:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" value="{$row['province'] . $row['city'] . $row['district']|htmlentities}" disabled />
        </div>
    </div>
    <?php endif;?>
    
    <div class="form-group">
        <div class="col-xs-12 col-sm-12 page-header">
            <h4><span class="glyphicon glyphicon-stop text-info"></span> 执行操作</h4>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">驳回原因:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" name="row[reject]" value="{$row['reject']|htmlentities}" <?= $row['status']!=10? 'disabled':'' ?> />
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">操作类型:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="radio" name="row[status]" value="10" 
                <?= $row['status']==10 ? 'checked':'' ?> 
                <?= $row['status']!=10 ? 'disabled':'' ?>> 
                保存
            <?php if($row['apply_type'] == 10 OR $row['apply_type'] == 30):?>
            <input type="radio" name="row[status]" value="20" 
                <?= $row['status']==20 ? 'checked':'' ?> 
                <?= $row['status']!=10 ? 'disabled':'' ?>> 
                提交审核
            <input type="radio" <?= $row['status']==30 ? 'checked':'' ?> disabled> 审核成功
            <?php else:?>
            <input type="radio" name="row[status]" value="30" 
                <?= $row['status']==30 ? 'checked':'' ?> 
                <?= $row['status']!=10 ? 'disabled':'' ?>> 
                审核成功
            <?php endif;?>
            <input type="radio" name="row[status]" value="40" 
                <?= $row['status']==40 ? 'checked':'' ?> 
                <?= $row['status']!=10 ? 'disabled':'' ?>> 
                资料驳回
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <?php if($row['status'] == 10):?>
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <?php endif;?>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
